<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>memberForm</title>
<SCRIPT type="text/javascript">
	$(function() {

		$("#memberForm :input[type=text]:visible:enabled:first").focus();
	});
</SCRIPT>
</head>
<body>

	<div id="memberForm">
		<form
			action="${pageContext.request.contextPath }/member/memberInsert.do"
			method="get" id="memberForm">
			<img src="<%=request.getContextPath()%>/images/memberForm.png"
				class="img" />

			<table class="table">
				<tr>
					<th class="empty"></th>
					<td class="notice">*는 필수 입력사항입니다.</td>
				</tr>
				<tr>
					<th>*아이디</th>
					<Td><input type="text" size="14" name="mb_id" id="mb_id" /></Td>
				</tr>

				<tr>
					<th>*패스워드</th>
					<Td><input type="password" size="20" name="mb_password" id="mb_password" /></Td>
				</tr>

				<tr>
				<th>*패스워드 확인</th>
				<Td><input type="password" size="20" name="mb_passwordre" id="mb_passwordre" /></Td>
				</tr>

				<tr>
					<th>*별명</th>
					<Td><input type="text" size="8" name="mb_name" id="mb_name" /></Td>
				</tr>


				<tr>
					<th>*E-Mail</th>
					<Td><input type="text" name="mb_email1" id="mb_email1" size="15" /> 
					<SELECT name="mb_email2" id="mb_email2" >
							<option>선택</option>
							<option value="hanmail.net">hanmail.net</option>
							<option value="naver.com">naver.com</option>
							<option value="paran.com">paran.com</option>
							<option value="yahoo.com">yahoo.com</option>
							<option value="daum.net">daum.net</option>
							<option value="gmail.com">gmail.com</option>
							<option value="nate.com">nate.com</option>
					</SELECT></Td>
				</tr>

				<Tr>
					<th class="empty"></th>
					<td>
						<FIELDSET class="memberButton">
							<INPUT type="submit" value="가입" id="submit" name="submit" style="background: #EBEBEB;" />
							<INPUT type="button" value="취소" style="background: #EBEBEB;" />
						</FIELDSET>
					</td>
				</Tr>


			</table>
		</form>
	</div>

	<SCRIPT type="text/javascript">
		$(document).ready(
				function() {
					$('#mb_id').focus();
					$('#submit').click(
							function() {
								if ($('#mb_id').val() == "") {
									alert("아이디를 입력하세요.");
									$('#mb_id').focus();
									return;
								} else if ($('#mb_id').val().length < 4
										|| $('#mb_id').val().length > 12) {
									alert("아이디는 4글자 이상 12글자 이하입니다.");
									$('#mb_id').focus();
									return;
								}

								if ($('#mb_password').val() == "") {
									alert("패스워드를 입력하세요.");
									$('#mb_password').focus();
									return;
								}
								if ($('#mb_passwordre').val() == "") {
									alert("패스워드 확인을 입력하세요.");
									$('#mb_passwordre').focus();
									return;
								}

								if ($('#mb_password').val() != $('#mb_passwordre').val()) {
									alert("패스워드가 서로 같지 않습니다.");
									$('#mb_passwordre').focus();
									return;
								}
								
								if ($('#mb_name').val() == "") {
									alert("별명을 꼭 입력하세요.");
									$('#mb_name').focus();
									return;
								}

							});

// 					$(':text,password').focus(function() {
// 						$(this).addClass('cursor');
// 					});

// 					$(':text,password').blur(function() {
// 						$(this).removeClass('cursor');
// 					});
				});
	</SCRIPT>

</body>
</html>